from django.conf.urls.defaults import patterns, include, url
from icpcweb.views import *
from board.views import *
import os

ROOT_PATH = os.path.dirname(__file__)

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'sogang_icpc_web.views.home', name='home'),
    # url(r'^sogang_icpc_web/', include('sogang_icpc_web.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    (r'^$', main_page),
    (r'^member_list/$', member_list),
    (r'^board/$', index),
    (r'^road_map/$', road_map),
    (r'^login/$', login),
    (r'^login_register/$', login_register),
    (r'^register_page/$', register_page),
    (r'^register/$', register),

    (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root':ROOT_PATH+'/media/'}),
    
    (r'^admin/', include(admin.site.urls)),
    (r'^blog/$', index),
    (r'^blog/page/(?P<page>\d+)/$', index),

    (r'^blog/entry/(?P<entry_id>\d+)/$', read),
    (r'^blog/write/$', write_form),
    (r'^blog/add/post/$', add_post),
    (r'^blog/add/comment/$', add_comment),
    (r'^blog/delete/comment/$', delete_comment),
)
